import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace PhotoDeliveryApi {
  /** 照片交付记录信息 */
  export interface PhotoDelivery {
    id: number; // 
    deliveryId?: string; // 交付ID
    bookingId?: string; // 预约ID
    photoUrl: string; // 照片URL列表(JSON)
    deliveryDate: string | Dayjs; // 交付日期
    status: string; // 交付状态
  }
}

/** 查询照片交付记录分页 */
export function getPhotoDeliveryPage(params: PageParam) {
  return requestClient.get<PageResult<PhotoDeliveryApi.PhotoDelivery>>('/wedding/photo-delivery/page', { params });
}

/** 查询照片交付记录详情 */
export function getPhotoDelivery(id: number) {
  return requestClient.get<PhotoDeliveryApi.PhotoDelivery>(`/wedding/photo-delivery/get?id=${id}`);
}

/** 新增照片交付记录 */
export function createPhotoDelivery(data: PhotoDeliveryApi.PhotoDelivery) {
  return requestClient.post('/wedding/photo-delivery/create', data);
}

/** 修改照片交付记录 */
export function updatePhotoDelivery(data: PhotoDeliveryApi.PhotoDelivery) {
  return requestClient.put('/wedding/photo-delivery/update', data);
}

/** 删除照片交付记录 */
export function deletePhotoDelivery(id: number) {
  return requestClient.delete(`/wedding/photo-delivery/delete?id=${id}`);
}


/** 导出照片交付记录 */
export function exportPhotoDelivery(params: any) {
  return requestClient.download('/wedding/photo-delivery/export-excel', { params });
}

